package com.csyf.manager.schedule;

import com.csyf.manager.service.impl.SysAgentBalanceBiz;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * @Description 定时任务：将清算资金汇总到用户账户中
 * @Date 每日下午两点
 */
@Slf4j
public class ClearingProcessSchedule implements Job {


    @Autowired
    private SysAgentBalanceBiz sysAgentBalanceBiz;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        log.info("\n=================================\nClearingProcessSchedule\n===============================>>");

        log.info("scheduled : {}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));

        log.info("0 0 14 * * ? ");

        log.info("----- 汇总未清算资金，更新用户余额账户-------");
        sysAgentBalanceBiz.updateTotalMoney(1);

    }




}
